module("framework.core.eventsystem.DispatchItem",package.seeall)

---@class DispatchItem : MiddleClass
local DispatchItem = class("DispatchItem")

--创建事件单位对象池
function DispatchItem.createPool()
    DispatchItem._pool = LuaObjPool.New(32, DispatchItem._poolNew, DispatchItem._poolRelease, DispatchItem._poolReset)
end

--获取对象池
function DispatchItem.getPool()
    if nil == DispatchItem._pool then
        DispatchItem.createPool()
    end
    return DispatchItem._pool
end

function DispatchItem._poolNew()
    return DispatchItem.New()
end

function DispatchItem._poolRelease(luaObj)
    luaObj:release()
end

function DispatchItem._poolReset(luaObj)
    luaObj:reset()
end

function DispatchItem:ctor()
	self:reset()
end

function DispatchItem:release()
    self:reset()
end

function DispatchItem:reset()
    self.eventName = nil
    self.eventArgs = nil
end

return DispatchItem
